package com.yanqu.road.server.cmd.orewar.cross;

import com.yanqu.road.pb.orewar.OreWarProto;
import com.yanqu.road.server.cmd.base.AbstractCommand;
import com.yanqu.road.server.command.Cmd;
import com.yanqu.road.server.gameplayer.GamePlayer;
import com.yanqu.road.server.manger.activity.orewar.OreWarMgr;
import com.yanqu.road.message.YanQuMessage;
import com.yanqu.road.server.protocol.Protocol;

@Cmd(code = Protocol.S_CROSS_ORE_WAR_PIT_STATION_SYNC, desc = "跨服同步坑位简略信息")
public class CrossPitStationSyncCmd extends AbstractCommand {

	private int activityId;

	private boolean isAllSync;

	private int groupId;

	@Override
	public boolean parseData(YanQuMessage packet) throws Exception {
		return true;
	}

	@Override
	public void execute(GamePlayer player, YanQuMessage packet) throws Exception {
		OreWarProto.CrossOreStationSyncMsg crossSyncMsg = OreWarProto.CrossOreStationSyncMsg.parseFrom(packet.getBytes());
		activityId = crossSyncMsg.getActivityId();
		isAllSync = crossSyncMsg.getIsAllSync();
		groupId = crossSyncMsg.getGroupId();
		OreWarMgr.crossPitStationSync(activityId,crossSyncMsg.getCrossOreStationList(),isAllSync,groupId);
	}

	@Override
	public void sendData(GamePlayer player) {

	}
}
